<template>
  <div class="productOpenwecart">
    <!-- 顶部Logo区域 -->
    <div class="logo-container">
      <div class="logo-icon">
        <img
          style="max-height: 45px"
          src="@/assets/template/open_logo.png"
          alt=""
        />
      </div>
    </div>

    <!-- 核心价值标题区域 -->
    <div class="value-title-container">
      <h1 class="main-title">云平台的核心价值优势</h1>
      <p class="subtitle">弹性扩容，适配业务生长节奏</p>
    </div>

    <!-- 开启按钮 -->
    <div class="button-container">
      <button class="open-wecart-btn" @click="handleOpenWeStep">
        开启我的微官网
      </button>
    </div>

    <!-- 核心价值卡片区域 -->
    <div class="value-cards-container">
      <!-- 弹性资源池卡片 -->
      <div class="value-card">
        <div class="card-icon blue-icon">
          <img src="@/assets/template/open1.png" alt="" />
        </div>
        <h3 class="card-title">弹性资源池</h3>
        <div class="card-divider blue-divider"></div>
        <ul class="card-features one">
          <li><span class="dian">.</span> 按需弹性调配算力资源</li>
          <li><span class="dian">.</span>业务高峰低谷自如应对</li>
          <li><span class="dian">.</span>资源不闲置，需求不等待，精准贴合业务动态变化节奏</li>
        </ul>
      </div>

      <!-- 全场景适配卡片 -->
      <div class="value-card">
        <div class="card-icon green-icon">
          <img src="@/assets/template/open2.png" alt="" />
        </div>
        <h3 class="card-title">全场景适配</h3>
        <div class="card-divider green-divider"></div>
        <ul class="card-features two">
          <li><span class="dian">.</span>覆盖多行业业务场景</li>
          <li><span class="dian">.</span>灵活适配业务不同生长阶段</li>
          <li><span class="dian">.</span>降低运维成本与难度；</li>
        </ul>
      </div>

      <!-- 智能自运维卡片 -->
      <div class="value-card">
        <div class="card-icon orange-icon">
          <img src="@/assets/template/open3.png" alt="" />
        </div>
        <h3 class="card-title">智能自运维</h3>
        <div class="card-divider orange-divider"></div>
        <ul class="card-features three">
          <li><span class="dian">.</span>智能感知业务负载</li>
          <li><span class="dian">.</span>自动触发扩容/缩容,无需人工干预</li>
          <li><span class="dian">.</span>降低运维成本与难度</li>
        </ul>
      </div>

      <!-- 生态协同网卡片 -->
      <div class="value-card">
        <div class="card-icon yellow-icon">
          <img src="@/assets/template/open4.png" alt="">

        </div>
        <h3 class="card-title">生态协同网</h3>
        <div class="card-divider yellow-divider"></div>
        <ul class="card-features four">
          <li><span class="dian">.</span>打通上下游业务系统</li>
          <li><span class="dian">.</span>构建协同生态，数据流通更顺畅</li>
          <li><span class="dian">.</span>助力业务生态化生长，放大平台价</li>
          <li>值</li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "productOpenwecart",
  data() {
    return {};
  },
  mounted() {
    // 禁止点击浏览器返回按钮
    // 挂载时添加一个历史记录
    history.pushState(null, null, document.URL);
    // 监听浏览器返回事件
    window.addEventListener("popstate", this.handlePopState);
  },
  beforeUnmount() {
    // 组件卸载时移除事件监听，避免内存泄漏
    window.removeEventListener("popstate", this.handlePopState);
  },

  methods: {
    handlePopState() {
      // 当用户点击返回时，再添加一个历史记录，阻止回到上一页
      history.pushState(null, null, document.URL);
      // 可以在这里添加提示信息，告知用户不能返回
      // alert('当前页面禁止返回');
    },
    handleOpenWeStep() {
      // 点击按钮的处理逻辑可以在这里添加
      console.log("开启我的微官网");
      this.$router.push("/productOpenstep");
    },
  },
};
</script>

<style scoped>
/* 页面基础样式 */
.productOpenwecart {
  width: 100%;
  height: 100vh;
  background-image: url("@/assets/template/open_back.png");
  background-repeat: no-repeat;
  display: flex;
  background-size: 100% 100%;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;
  overflow: hidden;
}

/* Logo样式 */
.logo-container {
  margin-bottom: 20px;
}

.logo-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: #fff;
  background: linear-gradient(0deg, #f7fbff 0%, #f5f9ff 100%);
  box-sizing: border-box;
  /* 纯白 */
  border: 1px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.logo-inner {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: white;
  position: relative;
}

.logo-inner::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 4px solid #667eea;
  border-radius: 8px;
}

.logo-inner::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: #667eea;
  border-radius: 4px;
}

/* 标题样式 */
.value-title-container {
  text-align: center;
  margin-bottom: 30px;
}

.main-title {
  font-size: 32px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 10px 0;
}

.subtitle {
  font-size: 16px;
  color: #7f8c8d;
  margin: 0;
}

/* 按钮样式 */
.button-container {
  margin-bottom: 40px;
}

.open-wecart-btn {
  border-radius: 14px;
  opacity: 1;
  font-weight: bold;
  background: linear-gradient(100deg, #348cf8 0%, #346ff8 100%);
  box-shadow: inset 0px 4px 10px 0px #92c3ff;
  color: white;
  border: none;
  padding: 12px 60px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  min-width: 200px;
}

.open-wecart-btn:hover {
  background-color: #40a9ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.open-wecart-btn:active {
  background-color: #096dd9;
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(24, 144, 255, 0.2);
}

/* 核心价值卡片容器 */
.value-cards-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  width: 100%;
  /* max-width: 1200px; */
  /* padding: 0 40px; */
}

/* 卡片通用样式 */
.value-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  width: 270px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 卡片图标 */
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 24px;
  color: white;
}

.blue-icon {
  background: linear-gradient(135deg, #348cf8 0%, #346ff8 100%);
}

.green-icon {
  background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
}

.orange-icon {
  background: linear-gradient(135deg, #fa8c16 0%, #d46b08 100%);
}

.yellow-icon {
  background: linear-gradient(135deg, #faad14 0%, #d48806 100%);
}

/* 图标内容 */
.icon-resource::before {
  content: "⚡";
  font-size: 28px;
}

.icon-scene::before {
  content: "🌐";
  font-size: 28px;
}

.icon-ai::before {
  content: "🤖";
  font-size: 28px;
}

.icon-ecosystem::before {
  content: "🔄";
  font-size: 28px;
}

/* 卡片标题 */
.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 12px 0;
}

/* 卡片分隔线 */
.card-divider {
  height: 3px;
  width: 35px;
  border-radius: 2px;
  margin-bottom: 20px;
}

.blue-divider {
  background: linear-gradient(90deg, #348cf8 0%, #346ff8 100%);
}

.green-divider {
  background: linear-gradient(90deg, #52c41a 0%, #389e0d 100%);
}

.orange-divider {
  background: linear-gradient(90deg, #fa8c16 0%, #d46b08 100%);
}

.yellow-divider {
  background: linear-gradient(90deg, #faad14 0%, #d48806 100%);
}

/* 卡片特性列表 */
.card-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-features li {
  font-size: 14px;
  color: #7f8c8d;
  line-height: 1.8;
  margin-bottom: 8px;
  position: relative;
  padding-left: 0;
}

.card-features li:last-child {
  margin-bottom: 0;
}


/* 响应式设计 */
@media (max-width: 1200px) {
  .value-cards-container {
    flex-wrap: wrap;
    gap: 30px;
  }

  .value-card {
    width: calc(50% - 15px);
    max-width: 300px;
  }
}

@media (max-width: 768px) {
  .productOpenwecart {
    padding-top: 40px;
    height: auto;
    padding-bottom: 60px;
  }

  .main-title {
    font-size: 24px;
  }

  .subtitle {
    font-size: 14px;
  }

  .button-container {
    margin-bottom: 50px;
  }

  .open-wecart-btn {
    padding: 10px 40px;
    font-size: 14px;
  }

  .value-cards-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .value-card {
    width: 100%;
    max-width: 300px;
    padding: 20px;
  }
}
</style>
